package com.rpay.service.admin.impl;

import com.rpay.dao.mapper.RpayAdminRoleMapper;
import com.rpay.model.admin.RpayAdminRole;
import com.rpay.model.admin.RpayAdminUser;
import com.rpay.service.admin.ISecRoleService;
import com.rpay.service.base.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 */
@Service(value = "secRoleServiceImpl")
public class SecRoleServiceImpl extends BaseServiceImpl<RpayAdminRole> implements ISecRoleService {

    @Autowired
    private RpayAdminRoleMapper secRoleMapper;


    /**
     * 查询用户创建的角色列表
     *
     * @param user 用户
     * @return 查询结果
     */
    @Override
    public List<RpayAdminRole> listRole(RpayAdminUser user) {
        return secRoleMapper.listRole(user);
    }

    @Override
    public RpayAdminRole findRole(RpayAdminRole role) {
        return secRoleMapper.selectOne(role);
    }
}
